import React, { useState } from 'react';
import GameBoard from './components/GameBoard';
import StartScreen from './components/StartScreen'; // 导入 StartScreen 组件
import './App.css';

function App() {
  const [gameStarted, setGameStarted] = useState(false); // 添加游戏状态

  // 处理开始游戏的函数
  const handleStartGame = () => {
    setGameStarted(true);
  };

  return (
    <div className="App">
      {/* 根据 gameStarted 状态决定显示哪个组件 */}
      {!gameStarted ? (
        <StartScreen onStartGame={handleStartGame} />
      ) : (
        <GameBoard />
      )}
    </div>
  );
}

export default App;
